#include "cdsl.h"

#define map_free(m, e)                                  \
  do { if ((m)->_free) (m)->_free(e); } while(0)

#define map_comp(m, e1, e2)                     \
  ((m)->_comp(e1, e2))

static void __map_free_element(struct rb_tree_node *node)
{
    struct map_kv_pair *kv = rb_tree_entry(node, struct map_kv_pair, me);

    if (
}

int __internal_rb_comp(struct rb_tree_node* n1, struct rb_tree_node* n2)
{
    struct map_element *e1 = rb_tree_entry(n1, struct map_element, me);
    struct map_element *e2 = rb_tree_entry(n2, struct map_element, me);

    return map_comp(e1, e2);
}


static void __map_clear(struct map *m)
{
    if (m) {
        rb_tree_clear(&m->rb);
        m->size = 0;
    }
} 
